package com.lagou.demo.config;

import com.lagou.bootPro.registration.MyServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.DispatcherServlet;

/**
 * @ClassName AppConfig
 * @Description
 * @Author playboy
 * @Date 2021/5/15 7:41 下午
 * @Version 1.0
 **/
@Configuration
@ComponentScan("com.lagou.demo")
public class AppConfig {

	@Bean
	public DispatcherServlet dispatcherServlet() {
		DispatcherServlet dispatcherServlet = new DispatcherServlet();
		return dispatcherServlet;
	}

	@Bean
	public MyServletRegistrationBean servletRegistrationBean(DispatcherServlet dispatcherServlet) {
		MyServletRegistrationBean servletRegistrationBean = new MyServletRegistrationBean(dispatcherServlet);
		return servletRegistrationBean;
	}

}
